
<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>: <@s.m "shop.function.product"/> - <@s.m "product.function"/> - 属性</div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt">
                            <input type="hidden" name="ctgId" value="${ctgId!}"/>
                            <input type="submit" value="返回列表" onclick="this.form.action='list.do';"/>
                        </form>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form action="o_productFashPicUpdate.do" method="post" class="am-form">
                            <input type="hidden" name="ctgId" value="${ctgId!}"/>
                            <input type="hidden" name="productid" value="${product.id}"/>
                            <input type="hidden" name="fashionid" value="${fashion.id}"/>
                            <table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" border="0">

                                <tr id="cc"><td class="pn-flabel pn-flabel-h">全方位图片：</td><td class="pn-fcontent"><input type="button" value="增加图片" onclick="addPicLine()"></td></tr>
                                <tr><td class="pn-flabel pn-flabel-h"></td><td class="pn-fcontent" id="pictures">
                                    <#if fashion.fashionPics??>
                                        <#list fashion.fashionPics as img>
                                            <table id="picTable${img_index}" border="0" style="float: left;">
                                                <tr>
                                                    <td>
                                                        <div><input type="text" value="${img}" id="uploadImgPath${img_index}" name="picPaths"
                                                                    style="width: 160px" /> <a href="javascript:void(0);"
                                                                                               onclick="$('#picTable${img_index}').remove();" class="pn-opt">删除</a></div>
                                                        <div><span id="ufc${img_index}"><input type="file"
                                                                                               id="uploadFile${img_index}" size="10" style="width: 150px" /></span> <input
                                                                type="button" value="上传" onclick="upload(${img_index});"/></div>
                                                        <div><textarea style="width:200px;height:60px;" name="picDescs" maxlength="255"></textarea></div>
                                                    </td>
                                                    <td><img src="${uploadRoot}${img}" id="preImg{0}" alt="预览" noResize="true" style="overflow:hidden;width:90px;height:90px;background-color:#ccc;border:1px solid #333"/></td>
                                                </tr>
                                            </table>
                                        </#list>
                                    </#if>
                                    <div id="picBefore" style="clear:both"></div>
                                </td></tr>
                            </table>
                            <input type="submit" onclick="return ff()" value="修改">
                        </form>
            </div>
    </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <textarea id="picTable" style="display: none;">
                            <table id="picTable{0}"  class="am-table am-table-striped am-table-hover table-main">
                                <tr>
                                    <td>
                                        <div><input type="text" id="uploadImgPath{0}" name="picPaths"
                                                    style="width: 160px" /> <a href="javascript:void(0);"
                                                                               onclick="$('#picTable{0}').remove();" class="pn-opt">删除</a></div>
                                        <div><span id="ufc{0}"><input type="file"
                                                                      id="uploadFile{0}" size="10" style="width: 150px" /></span> <input
                                                type="button" value="上传" onclick="upload({0});"/></div>
                                        <div>&lt;textarea style="width:200px;height:60px;" name="picDescs" maxlength="255"&gt;&lt;/textarea&gt;</div>
                                    </td>
                                    <td><img id="preImg{0}" alt="预览" noResize="true" style="overflow:hidden;width:90px;height:90px;background-color:#ccc;border:1px solid #333"/></td>
                                </tr>
                            </table>
                        </textarea>


                        <#include "/common/image_upload.html"/>
                    </div>
                </div>


    </div>

    </div>








<script type="text/javascript">
$(function() {
	$("#baseForm").validate();
});
function addx(){
	var aa = $("#context").html();
	$("#cc").before(aa);
}
function dele(a){
	var b =$(a).parent();
	$(b).parent().remove();
	
}
</script>







</body>

<script type="text/javascript">
var picIndex = 0;
<#if product.productExt.productImgs??>
picIndex = ${product.productExt.imgs?size};
</#if>
	var picTpl = $.format($("#picTable").val());
	function addPicLine() {
		$('#picBefore').before(picTpl(picIndex++));
	}
</script>
</html>